package com.zhibang.report.controller;

import com.sannuo.common.domain.Rate;
import com.sannuo.common.result.Result;
import com.sannuo.common.result.ResultCode;
import com.zhibang.report.service.RateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/Rate")
public class RateController {
    @Autowired
    private RateService rateService;

    @RequestMapping("gh1")
    public Result findYield() throws Exception {
            List<Rate> h1=rateService.selectRate();

            for (Rate yield : h1) {
                System.out.println(yield);
            }

            return  Result.ok(ResultCode.SUCCESS,h1);
        }

    }

